<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
   xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:pb="http://b2b.pb.com/tags">

<ui:composition template="/template/MainTemplate.xhtml">
   <ui:define name="body">
      <pb:saveBean beanName="languageBean" bean="#{languageBean}" />

      <h:panelGroup rendered="#{empty languageBean.languageList}">
         <div class="error_msg">
            <div class="error_msg_top">
               <div class="error_msg_img" />
            </div>
            <div class="error_msg_cont">
               <div class="error_msg_txt">
                  <h:outputText value="#{languageBundle.language_list_empty}" />
               </div>
            </div>
            <div class="error_msg_bottom" />
         </div>
      </h:panelGroup>

      <p:panel header="#{languageBundle.language_tbl_header}" rendered="#{not empty languageBean.languageList}">
         <p:dataTable id="langDTable" var="language" value="#{languageBean.languageList}" rowKey="#{language.id}"
            selection="#{languageBean.selectedLanguage}" paginator="#{languageBean.languageList.size() > 10}" rows="10">

            <p:column selectionMode="single" style="width:30px" />

            <p:column headerText="#{languageBundle.lbl_language_name}">
               <h:outputText value="#{language.name}" />
            </p:column>

            <p:column headerText="#{languageBundle.lbl_language_code}">
               <h:outputText value="#{language.code}" />
            </p:column>

            <p:column headerText="#{languageBundle.lbl_language_active}" style="text-align:center;">
               <h:outputText value="#{language.active}" />
            </p:column>

            <p:column headerText="#{languageBundle.lbl_language_status}">
               <h:outputText value="#{language.status}" />
            </p:column>
         </p:dataTable>
      </p:panel>

      <h:panelGroup id="buttonsPanel">
         <div class="marginTop7">
            <div class="btnRightCol">
               <p:commandButton action="CreateLanguageStart?faces-redirect=true"
                  value="#{languageBundle.btn_create_language}" ajax="false" styleClass="btn200" />
            </div>
            <h:panelGroup rendered="#{not empty languageBean.languageList}">
               <div class="btnRightCol">
                  <p:commandButton action="#{languageBean.initChangeLanguage}"
                     value="#{languageBundle.btn_change_language}" ajax="false" styleClass="btn200" />
               </div>
               <div class="btnRightCol">
                  <p:commandButton action="#{languageBean.defaultConfirmAction}"
                     value="#{languageBundle.btn_set_default_language}" ajax="false" styleClass="btn200" />
               </div>
            </h:panelGroup>
         </div>
      </h:panelGroup>

   </ui:define>
</ui:composition>
</html>